package com.russell.pms.model;

import javax.xml.bind.annotation.XmlRootElement;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

@XmlRootElement(name = "property")
public class Property extends BaseObject {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2345145488891820497L;
	private int id;
	private String description;
	private String street;
	private String city;
	private String state;
	private String zip;

	@Override
	public boolean equals(Object o) {
		if (!(o instanceof Property)) {
			return false;
		}
		Property rhs = (Property) o;
		return new EqualsBuilder().append(this.id, rhs.id).isEquals();
	}

	public String getCity() {
		return city;
	}

	public String getDescription() {
		return description;
	}

	public int getId() {
		return id;
	}

	public String getState() {
		return state;
	}

	public String getStreet() {
		return street;
	}

	public String getZip() {
		return zip;
	}

	@Override
	public int hashCode() {
		return new HashCodeBuilder(1, 31).append(id).toHashCode();

	}

	public void setCity(String city) {
		this.city = city;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public void setId(int id) {
		this.id = id;
	}

	public void setState(String state) {
		this.state = state;
	}

	public void setStreet(String street) {
		this.street = street;
	}

	public void setZip(String zip) {
		this.zip = zip;
	}

	@Override
	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
				.append("id", this.id).toString();
	}

}
